package me.jianghs.service;

import me.jianghs.thrift.DataException;
import me.jianghs.thrift.Student;
import me.jianghs.thrift.StudentService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class MyServerServiceImpl implements StudentService.Iface {
    private final Logger logger = LoggerFactory.getLogger(getClass());
    @Override
    public Student getStudentByName(String name) {
        logger.info("服务端收到客户端获取用户名:{}信息", name);
        Student student = new Student();
        student.setName(name);
        student.setAge(100);
        student.setAddress("深圳");

        logger.info("模拟获取成功并返回:{}", student);
        return student;
    }

    @Override
    public void save(Student student) {
        logger.info("服务端收到客户端请求保存学生信息：" + student);
        logger.info("模拟保存成功!!!");
    }
}
